//
//  MovieCollectionViewCell.m
//  FNer
//
//  Created by dllo on 15/11/6.
//  Copyright © 2015年 刘志强. All rights reserved.
//

#import "MovieCollectionViewCell.h"

@implementation MovieCollectionViewCell
-(instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self creatCell];
       
    }
    return self;
}
-(void)creatCell
{
    
    self.bgPicture = [[UIImageView alloc]init];
    [self.bgPicture initWithRect:0 andY:0 andWidth:375 andheight:150];
    self.bgPicture.userInteractionEnabled = YES;
    [self.contentView addSubview:self.bgPicture];
    
    UIView *boliView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, WIDTH, 150 * XHIGHT)];
    boliView.backgroundColor = [UIColor colorWithRed:30 / 255.0 green:30 /255.0 blue:30 / 255.0 alpha:0.1];
    [self.bgPicture addSubview:boliView];
    
    self.name = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, WIDTH, 40 * XHIGHT)];
    self.name.center = CGPointMake(WIDTH / 2, 75 * XHIGHT);
    //    self.nameLabel.backgroundColor = [UIColor blackColor];
    self.name.textAlignment = NSTextAlignmentCenter;
    self.name.textColor = [UIColor whiteColor];
    self.name.font = [UIFont fontWithName:@"Helvetica-BoldOblique" size:25 * XWIDTH];
    
       self.name.alpha = 1.0;
  
    
       [boliView addSubview:self.name];
    

}
-(void)setModel:(MovieCoreData *)model
{
    _model = model;
    
    //NSLog(@"name====%@",_model.name);
    self.name.text = _model.name;
    
    NSURL *url = [NSURL URLWithString:_model.bgPicture];
    [self.bgPicture sd_setImageWithURL:url placeholderImage:[UIImage imageNamed:@""]];
    
    
    
}

@end
